using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class creature_equip_template : MangosBase
	{
		public System.UInt32? entry;
		public System.UInt32? equipentry1;
		public System.UInt32? equipentry2;
		public System.UInt32? equipentry3;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `creature_equip_template` (`entry`, `equipentry1`, `equipentry2`, `equipentry3`) VALUES ('{0}', '{1}', '{2}', '{3}');", entry.GetValueOrDefault(), equipentry1.GetValueOrDefault(), equipentry2.GetValueOrDefault(), equipentry3.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `creature_equip_template` SET ");
			if(equipentry1 != null)
			{
				sb.AppendLine("`equipentry1`='" + equipentry1.Value.ToString() + "'");
			}
			if(equipentry2 != null)
			{
				sb.AppendLine("`equipentry2`='" + equipentry2.Value.ToString() + "'");
			}
			if(equipentry3 != null)
			{
				sb.AppendLine("`equipentry3`='" + equipentry3.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
				sb.Append(" WHERE `entry`='" + entry.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
